/* $Header: dx_cmds.c,v 2.2 01/10/02 10:29:16 przybyls Exp $ */

/***********************************************************************/
/*                                                                     */
/*                  Copyright Hewlett-Packard Co. 1991                 */
/*                                                                     */
/***********************************************************************/

/***********************************************************************/
/* MODULE NAME: dx_cmds.c                                              */
/* ============                                                        */
/*                                                                     */
/* Author:  Bob Cook                                                   */
/*                                                                     */
/* MODULE PURPOSE: This module will handle the detector commands.      */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

/*
 */

/*****************************/
/*   GLOBAL INCLUDE FILES    */
/*****************************/

#include <typedefs.h>

#include <error.h>

#include <mio.h>
#include <cmd_set.h>
#include <cmdproc.h>
#include <method.h>
#include <hostutil.h>
#include <cmd_tbls.h>

#include <p_wkfile.h>
#include <p_status.h>
#include <det_ui.h>
#include <p_ui.h>

/*****************************/
/*   LOCAL INCLUDE FILES     */
/*****************************/



/*****************************/
/*   GLOBAL VARIABLES        */
/*****************************/


/*****************************/
/*   EXTERNAL VARIABLES      */
/*****************************/

extern CMD_QUEUE_TYPE  DX_Cmd_Q;


/*****************************/
/*   LOCAL DEFINES           */
/*****************************/

/*****************************/
/*   STATIC VARIABLES        */
/*****************************/


/*****************************/
/*   MACROS                  */
/*****************************/



/*****************************/
/*   IMPLEMENT SECTION       */
/*****************************/





/***********************************************************************/
/* FUNCTION: DoDXEO                                                    */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Echo command.                                              */
/*                                                                     */
/* RETURNED VALUE: length of response string                           */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

INT16 DoDXEO(CMD_TYPE *p_cmd,BIT8  *p_resp_parm)
{
U_INT16 len;

   len = 0;

   if (p_cmd->parmv[0] == 1)
   {
      len = PutAsciiParam((BIT8 *)"\"", p_resp_parm);
      len += PutAsciiParam((BIT8 *)&(p_cmd->parms[p_cmd->parmv[1]]),
                                     p_resp_parm+len);
      len += PutAsciiParam((BIT8 *)"\"", p_resp_parm+len);
      return len;
   }
   else
   {
      CmdErrorHandler(p_cmd,1,INVALID_PARAM);
      return NO_RESPONSE;
   }
}

/***********************************************************************/
/* END FUNCTION: DoDXEO                                                */
/***********************************************************************/

/***********************************************************************/
/* FUNCTION: DoDXET                                                    */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Set and get electrometer title.                            */
/*                                                                     */
/* RETURNED VALUE: length of response string                           */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/*                                                                     */
/***********************************************************************/
INT16 DoDXET(CMD_TYPE *p_cmd,BIT8  *p_resp_parm,POSITION pos)
{
U_INT16 len;

len = 0;
mLog("Call DoDXET\n");
return len;
/*

   if ( (p_cmd->parmv[0] > 0) && (p_cmd->parms[p_cmd->parmv[1]] == '?') )
   {
      /* return current title 
     if(GetCPFDetTitlePresence(pos))
     {
        len += PutAsciiParam((BIT8 *)"{", p_resp_parm+len);
        len += PutAsciiParam(GetCPFDetTitle(pos), p_resp_parm+len);
        len += PutAsciiParam((BIT8 *)"}", p_resp_parm+len);
        return len;
     }
     else
     {
        len += PutAsciiParam((BIT8 *)"{", p_resp_parm+len);
        len += PutAsciiParam((BIT8 *)"}", p_resp_parm+len);
        return len;
     }
   }
   else
   {

      if (p_cmd->parmv[0] == 0)
      {
         /* null title clear electrometer title 
         ClearElectrometerTitle(pos);
         InstallElectrometerTitle(pos);
      }
      else if (p_cmd->parmv[0] == 1)
      {
         /* set electrometer title 
         if ( SetElectrometerTitle(pos, (BIT8 *)&p_cmd->parms[p_cmd->parmv[1]])
                         != OK )
         {
            CmdErrorHandler(p_cmd,1,INVALID_PARAM);
         }
      }
      else
      {
         CmdErrorHandler(p_cmd,2,INVALID_PARAM);
      }
      return NO_RESPONSE;
      }
      */
}
/***********************************************************************/
/* END FUNCTION: DoDXET                                                */
/***********************************************************************/


/***********************************************************************/
/* FUNCTION: DoDXSL                                                    */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Set and get name for signal units.                         */
/*                                                                     */
/* RETURNED VALUE: length of response string                           */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

INT16 DoDXSL(CMD_TYPE *p_cmd,BIT8  *p_resp_parm,POSITION pos)
{
U_INT16 len;

len = 0;
mLog("Call DoDXSL\n");
return len;
   /*
   if ( (p_cmd->parmv[0] > 0) && (p_cmd->parms[p_cmd->parmv[1]] == '?') )
   {
      /* return signal units title 
     len += PutAsciiParam((BIT8 *)"{", p_resp_parm+len);
     len += PutAsciiParam(GetDetSignalLabel(pos), p_resp_parm+len);
     len += PutAsciiParam((BIT8 *)"}", p_resp_parm+len);
     return len;
   }
   else
   {

      if (p_cmd->parmv[0] == 0)
      {
         /* null title clear units title 
         InitDetSignalLabel(pos);
      }
      else if (p_cmd->parmv[0] == 1)
      {
         /* set electrometer title 
         if ( SetDetSignalLabel(pos, (BIT8 *)&p_cmd->parms[p_cmd->parmv[1]])
                         != OK )
         {
            CmdErrorHandler(p_cmd,1,INVALID_PARAM);
         }
      }
      else
      {
         CmdErrorHandler(p_cmd,2,INVALID_PARAM);
      }
      return NO_RESPONSE;
   }
   */
}

/***********************************************************************/
/* END FUNCTION: DoDXSL                                                */
/***********************************************************************/

/***********************************************************************/
/* FUNCTION: DoDXAO                                                    */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Adjust offset command.                                     */
/*                                                                     */
/* RETURNED VALUE: length of response string                           */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

INT16 DoDXAO(CMD_TYPE *p_cmd,BIT8  *p_resp_parm)
{
  U_INT16 len;
  mLog("Call DoDXAO\n");
  /*
POSITION position;
DET_TYPE type;
UI_ERR retval;

   position = (p_cmd->dsap.char_dsap[1] == 'F') ? FRONT : BACK;
   type = GetDetectorType(position);

   if (p_cmd->parmv[0] < 1)
   {
      retval = MISSING_PARAM;
   }
   else if (type != ECD && type != NPD)
   {
      retval = NOT_COMPATIBLE;
   }
   else
   {
      switch (p_cmd->parms[p_cmd->parmv[1]])
      {
      case '0':
         /* there is no "off" for the ECD, so we just abort the offset seek 
         retval = (type == NPD) ? SetNPDBeadTurnOn(position, OFF) : StopECDOffsetSeek(position);
         break;

      case '1':
         retval = (type == NPD) ? StartNPDOffsetSeek(position) : StartECDOffsetSeek(position);
         break;

      case '2':
         retval = (type == NPD) ? StopNPDOffsetSeek(position) : StopECDOffsetSeek(position);
         break;

      default:
         retval = INVALID_PARAM;
      }
   }

   len = PutIntParam((INT32)retval, p_resp_parm, 0);
   */
   return len;
}

INT16 DoDXPC(CMD_TYPE *p_cmd, BIT8 *p_resp_parm )
{
   UI_ERR           error;
   U_INT8           param_xyz;
   U_INT16          type;
   INT32            chnl;
   INT32            value;
   pDETECTOR_STATUS status;

   param_xyz = 1;
   status = (p_cmd->dsap.char_dsap[1] == 'F') ? pFRONT_DETECTOR : pBACK_DETECTOR ;

   if ( p_cmd->parmv[0] != 3 )
   {
      error = MISSING_PARAM ;
      CmdErrorHandler( p_cmd, param_xyz, error );
      return NO_RESPONSE;
   }

   type = p_cmd->parms[0] - '0'; /* Get read_calib/do_calib op'n type */

   if ( ( type  >> 1 ) != 0 )
   {
      error = INVALID_PARAM ;
      CmdErrorHandler( p_cmd, param_xyz, error );
      return NO_RESPONSE;
   }

   /* Get the chnl;     */
   param_xyz = 2;
   if ((error = DecToInt(&p_cmd->parms[p_cmd->parmv[2]], 0, &chnl  )) == OK )
   {
      error = NOT_ALLOWED ;
      if (  (   chnl > 0          ) && (   chnl < 4          )      )
      {
         /* Get the "calpt" ( Calibration point: 0=ZERO , 1=~FULL_SCALE */
         param_xyz = 3;
         if ((error = DecToInt(&p_cmd->parms[p_cmd->parmv[3]], 0, &value)) == OK )
         {

            if ( type == 0 ) /* rtn results of last calibration  */
            {
               if (value == 0 )
               {
                  value = DcGetDetCalPresZero( status,chnl );
               }
               else
               {
                  value = DcGetDetCalPresValue( status,chnl );
               };

               return PutIntParam( value, p_resp_parm,0 ) ; /* Exit with results  */
            }
            else  /* type == 1  ==> perform NEW calibration */
            {
              if (value == 0 )
              {
                 error = DcSetDetCalPresZero( status,chnl );
              }
              else
              {
                 error = DcSetDetCalPres( status,chnl,value );
              };
              return PutIntParam( (INT32)error, p_resp_parm, 0 ); /* Exit with result code */
            }
         }
      }
   }

   CmdErrorHandler( p_cmd, param_xyz, error );
   return NO_RESPONSE;

}

/***********************************************************************/
/* END FUNCTION: DoDXAO                                                */
/***********************************************************************/

/***********************************************************************/
/* FUNCTION: DXOpcodes                                                 */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: calls routines to implement the Dx commands.               */
/*                                                                     */
/* RETURNED VALUE: none                                                */
/*                                                                     */
/* GLOBALS USED:                                                       */
/*                                                                     */
/* FILE SCOPE STATICS USED:                                            */
/*                                                                     */
/*                                                                     */
/* CALLS:                                                              */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

INT16 DXOpcodes(CMD_TYPE  *p_cmd,BIT8  *p_resp_parm,U_INT16 max_resp_len)
{
INT16           parm_len;

   (void) max_resp_len;

   parm_len = NO_RESPONSE;
   switch( p_cmd->opcode.int_op )
   {
	   /*
      case  MAKEINT('A','O'):
        parm_len = DoDXAO(p_cmd,p_resp_parm);
        break;
		*/
      case  MAKEINT('M','F'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFMF) : DoCmd(p_cmd,p_resp_parm,&mDBMF);
        break;
		/*
      case  MAKEINT('D','A'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFDA) : DoCmd(p_cmd,p_resp_parm,&mDBDA);
        break;
      case  MAKEINT('T','Z'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFTZ) : DoCmd(p_cmd,p_resp_parm,&mDBTZ);
        break;
      case  MAKEINT('T','R'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFTR) : DoCmd(p_cmd,p_resp_parm,&mDBTR);
        break;
      case  MAKEINT('T','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFTI) : DoCmd(p_cmd,p_resp_parm,&mDBTI);
             break;
             */

      case  MAKEINT('N','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNI) : DoCmd(p_cmd,p_resp_parm,&mDBNI);
        break;	  
      case  MAKEINT('N','F'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNF) : DoCmd(p_cmd,p_resp_parm,&mDBNF);
		break; 
      case  MAKEINT('N','T'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNT) : DoCmd(p_cmd,p_resp_parm,&mDBNT);
        break;
      case  MAKEINT('N','E'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNE) : DoCmd(p_cmd,p_resp_parm,&mDBNE);
		break;
		/*
      case  MAKEINT('N','H'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNH) : DoCmd(p_cmd,p_resp_parm,&mDBNH);
        break;
		*/
      case  MAKEINT('N','U'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNU) : DoCmd(p_cmd,p_resp_parm,&mDBNU);
        break;
      case  MAKEINT('N','N'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNN) : DoCmd(p_cmd,p_resp_parm,&mDBNN);
		break;
		/*
      case  MAKEINT('O','P'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFOP) : DoCmd(p_cmd,p_resp_parm,&mDBOP);
        break;
      case  MAKEINT('F','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFFI) : DoCmd(p_cmd,p_resp_parm,&mDBFI);
        break;
      case  MAKEINT('F','P'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFFP) : DoCmd(p_cmd,p_resp_parm,&mDBFP);
        break;
      case  MAKEINT('T','C'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFTC) : DoCmd(p_cmd,p_resp_parm,&mDBTC);
        break;
      case  MAKEINT('E','C'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFEC) : DoCmd(p_cmd,p_resp_parm,&mDBEC);
        break;
      case  MAKEINT('U','E'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFUE) : DoCmd(p_cmd,p_resp_parm,&mDBUE);
        break;
      case  MAKEINT('H','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFHI) : DoCmd(p_cmd,p_resp_parm,&mDBHI);
        break;
      case  MAKEINT('N','P'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFNP) : DoCmd(p_cmd,p_resp_parm,&mDBNP);
        break;
      case  MAKEINT('A','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFAI) : DoCmd(p_cmd,p_resp_parm,&mDBAI);
        break;
      case  MAKEINT('E','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFEI) : DoCmd(p_cmd,p_resp_parm,&mDBEI);
        break;
      case  MAKEINT('H','M'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFHM) : DoCmd(p_cmd,p_resp_parm,&mDBHM);
        break;
      case  MAKEINT('C','E'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFCE) : DoCmd(p_cmd,p_resp_parm,&mDBCE);
        break;
		*/
      case  MAKEINT('C','F'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFCF) : DoCmd(p_cmd,p_resp_parm,&mDBCF);
        break;
		/*
      case  MAKEINT('C','W'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFCW) : DoCmd(p_cmd,p_resp_parm,&mDBCW);
        break;
      case  MAKEINT('Z','W'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFZW) : DoCmd(p_cmd,p_resp_parm,&mDBZW);
        break;

      case  MAKEINT('P','C'):
        parm_len = DoDXPC(p_cmd,p_resp_parm);
        break;


      case  MAKEINT('F','Z'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFFZ) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBFZ);
        break;
		*/
      case  MAKEINT('Z','F'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFZF) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBZF);
        break;
      case  MAKEINT('Z','U'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFZU) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBZU);
        break;
      case  MAKEINT('Z','M'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFZM) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBZM);
        break;
      case  MAKEINT('L','F'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFLF) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBLF);
        break;
      case  MAKEINT('L','U'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFLU) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBLU);
        break;
      case  MAKEINT('L','M'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFLM) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBLM);
        break;
      case  MAKEINT('L','X'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmdWithResponse(p_cmd,p_resp_parm,&mDFLX) : DoCmdWithResponse(p_cmd,p_resp_parm,&mDBLX);
        break;

      case  MAKEINT('L','S'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoStatus(p_cmd,p_resp_parm,&mDFLS) :
                 DoStatus(p_cmd,p_resp_parm,&mDBLS);
        break;
      case  MAKEINT('S','T'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoStatus(p_cmd,p_resp_parm,&mDFST) :
                 DoStatus(p_cmd,p_resp_parm,&mDBST);
    break;
	/*
      case  MAKEINT('O','S'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
         DoStatus(p_cmd,p_resp_parm,&mDFOS) :
                 DoStatus(p_cmd,p_resp_parm,&mDBOS);
        break;

      case  MAKEINT('O','C'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoStatus(p_cmd,p_resp_parm,&mDFOC) :
         DoStatus(p_cmd,p_resp_parm,&mDBOC);
        break;
	 */
      case  MAKEINT('N','Z'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
              DoCmd(p_cmd,p_resp_parm,&mDFNZ) : DoCmd(p_cmd,p_resp_parm,&mDBNZ);
        break;
      //  CPF 
	/*
      case  MAKEINT('T','W'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFTW) : DoCmd(p_cmd,p_resp_parm,&mDBTW);
        break;
      case  MAKEINT('G','W'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFGW) : DoCmd(p_cmd,p_resp_parm,&mDBGW);
        break;
      case  MAKEINT('O','W'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFOW) : DoCmd(p_cmd,p_resp_parm,&mDBOW);
        break;
      case  MAKEINT('C','O'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFCO) : DoCmd(p_cmd,p_resp_parm,&mDBCO);
        break;
      case  MAKEINT('O','I'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFOI) : DoCmd(p_cmd,p_resp_parm,&mDBOI);
        break;
      case  MAKEINT('O','E'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFOE) : DoCmd(p_cmd,p_resp_parm,&mDBOE);
        break;
      case  MAKEINT('S','L'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoDXSL(p_cmd,p_resp_parm,FRONT) : DoDXSL(p_cmd,p_resp_parm,BACK);
            // DoCmd(p_cmd,p_resp_parm,&mDFSL) : DoCmd(p_cmd,p_resp_parm,&mDBSL);
        break;
      case  MAKEINT('E','L'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoCmd(p_cmd,p_resp_parm,&mDFEL) : DoCmd(p_cmd,p_resp_parm,&mDBEL);
        break;
      case  MAKEINT('E','T'):
        parm_len = (p_cmd->dsap.char_dsap[1] == 'F') ?
             DoDXET(p_cmd,p_resp_parm,FRONT) : DoDXET(p_cmd,p_resp_parm,BACK);
        break;

      case  MAKEINT('E','O'):
        parm_len = DoDXEO(p_cmd,p_resp_parm);
        break;
		*/
      default:
         parm_len = NO_RESPONSE;
         CmdErrorHandler(p_cmd,0,INVALID_OP);
		 mLog("no such dx_cmd\n");
         break;
   }

   return parm_len;
}


/***********************************************************************/
/* END FUNCTION: DXOpcodes                                             */
/***********************************************************************/




/***********************************************************************/
/* FUNCTION: DX_Cmds                                                   */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: calls function which executes a command if one is          */
/*          available on the command queue.                            */
/*                                                                     */
/* RETURNED VALUE: none                                                */
/*                                                                     */
/* GLOBALS USED:                                                       */
/*                                                                     */
/* FILE SCOPE STATICS USED:                                            */
/*                                                                     */
/*                                                                     */
/* CALLS:                                                              */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

void DX_Cmds(void)
{
   ExecCmds(&DX_Cmd_Q,DXOpcodes);
}

/***********************************************************************/
/* END FUNCTION: DX_Cmds                                               */
/***********************************************************************/
